package everydayGrade.t5;

/**
 * @Author: Siantar
 * @Date: 2023-07-22-20:11
 * @Description: 1.0
 */
public class T0860 {
    public boolean lemonadeChange(int[] bills) {
        int five = 0, ten = 0;
        for (int bill : bills) {
            if (bill == 5) five++;
            else if (bill == 10) {five--;ten++;}
            else if (ten > 0) {ten--;five--;}
            else five -= 3;
            if (five < 0) return false;
        }
        return true;
    }
}
